import 'normalize.css'; //重置样式
import 'element-plus/dist/index.css';
import './assets/css/reset.css';
import './assets/css/common.css';
import './permission';
// import Vuedraggable from 'vuedraggable'
import router from './router';
import store from '@/store/index';
// import 'bpmn-js-properties-panel/dist/assets/properties-panel.css'
import Dialog from './components/Dialog.vue';
import print from 'vue3-print-nb';
import {createApp} from 'vue';
import App from './App.vue';
import Directives from "@/directiver/index";
const app = createApp(App);
// 全局组件挂载
app.component('Dialog', Dialog);
app.use(router);
app.use(store);
app.use(print);
// 注册全局自定义指令
app.use(Directives);

import {TUIComponents, TUIChatKit, genTestUserSig} from './TUIKit';
import {TUILogin} from '@tencentcloud/tui-core';

// Your SDKAppID
const SDKAppID = 1600039604;

//Your secretKey
const secretKey = 'ba030204d0cffc26fa73ad3e448d0530fe749311dbe8aa2ba71696e192237a7f';
if (localStorage.getItem('roleInfo')) {
  if (JSON.parse(localStorage.getItem('roleInfo')).company == 0) {
    if (localStorage.getItem('ShopId')) {
      var userID = 'S' + localStorage.getItem('ShopId');
    } else {
      var userID = 'P001'; // User ID
    }
  } else {
    var userID = 'S' + localStorage.getItem('ShopId');
  }
  // TUIChatKit add TUIComponents
  TUIChatKit.components(TUIComponents, app);
  // TUIChatKit init
  TUIChatKit.init();
  // TUICore login
  TUILogin.login({
    SDKAppID,
    userID,
    // UserSig 是用户登录即时通信 IM 的密码，其本质是对 UserID 等信息加密后得到的密文。
    // 该方法仅适合本地跑通 Demo 和功能调试，详情请参见 https://cloud.tencent.com/document/product/269/32688
    userSig: genTestUserSig({
      SDKAppID,
      secretKey,
      userID,
    }).userSig,
    // 如果您需要发送图片、语音、视频、文件等富媒体消息，请设置为 true
    useUploadPlugin: true,
    // 本地审核可识别、处理不安全、不适宜的内容，为您的产品体验和业务安全保驾护航
    // 此功能为增值服务，请参考：https://cloud.tencent.com/document/product/269/79139
    // 如果您已购买内容审核服务，开启此功能请设置为 true
    useProfanityFilterPlugin: false,
    framework: 'vue3',
  });
  TUILogin.setLogLevel(4);
}
app.mount('#app');
export {SDKAppID, secretKey};
